home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / layout / nsICSSStyleSheet.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  113 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37. #ifndef nsICSSStyleSheet_h___
  38. #define nsICSSStyleSheet_h___
  39.  
  40. #include "nsIStyleSheet.h"
  41. #include "nsString.h"
  42.  
  43. class nsICSSRule;
  44. class nsIDOMNode;
  45. class nsXMLNameSpaceMap;
  46. class nsCSSRuleProcessor;
  47. class nsMediaList;
  48. class nsICSSGroupRule;
  49. class nsICSSImportRule;
  50.  
  51. // IID for the nsICSSStyleSheet interface
  52. // 446df065-af5e-46b8-b32f-289bf5906876
  53. #define NS_ICSS_STYLE_SHEET_IID     \
  54. {0x446df065, 0xaf5e, 0x46b8, {0xb3, 0x2f, 0x28, 0x9b, 0xf5, 0x90, 0x68, 0x76}}
  55.  
  56. class nsICSSStyleSheet : public nsIStyleSheet {
  57. public:
  58.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICSS_STYLE_SHEET_IID)
  59.  
  60.   NS_IMETHOD  ContainsStyleSheet(nsIURI* aURL, PRBool& aContains, nsIStyleSheet** aTheChild=nsnull) = 0;
  61.  
  62.   NS_IMETHOD  AppendStyleSheet(nsICSSStyleSheet* aSheet) = 0;
  63.   NS_IMETHOD  InsertStyleSheetAt(nsICSSStyleSheet* aSheet, PRInt32 aIndex) = 0;
  64.  
  65.   // XXX do these belong here or are they generic?
  66.   NS_IMETHOD  PrependStyleRule(nsICSSRule* aRule) = 0;
  67.   NS_IMETHOD  AppendStyleRule(nsICSSRule* aRule) = 0;
  68.   NS_IMETHOD  ReplaceStyleRule(nsICSSRule* aOld, nsICSSRule* aNew) = 0;
  69.  
  70.   NS_IMETHOD  StyleRuleCount(PRInt32& aCount) const = 0;
  71.   NS_IMETHOD  GetStyleRuleAt(PRInt32 aIndex, nsICSSRule*& aRule) const = 0;
  72.  
  73.   NS_IMETHOD  DeleteRuleFromGroup(nsICSSGroupRule* aGroup, PRUint32 aIndex) = 0;
  74.   NS_IMETHOD  InsertRuleIntoGroup(const nsAString & aRule, nsICSSGroupRule* aGroup, PRUint32 aIndex, PRUint32* _retval) = 0;
  75.   NS_IMETHOD  ReplaceRuleInGroup(nsICSSGroupRule* aGroup, nsICSSRule* aOld, nsICSSRule* aNew) = 0;
  76.  
  77.   NS_IMETHOD  StyleSheetCount(PRInt32& aCount) const = 0;
  78.   NS_IMETHOD  GetStyleSheetAt(PRInt32 aIndex, nsICSSStyleSheet*& aSheet) const = 0;
  79.  
  80.   /**
  81.    * SetURIs must be called on all sheets before parsing into them.
  82.    * SetURIs may only be called while the sheet is 1) incomplete and 2)
  83.    * has no rules in it
  84.    */
  85.   NS_IMETHOD  SetURIs(nsIURI* aSheetURI, nsIURI* aBaseURI) = 0;
  86.   NS_IMETHOD  SetTitle(const nsAString& aTitle) = 0;
  87.   NS_IMETHOD  SetMedia(nsMediaList* aMedia) = 0;
  88.   NS_IMETHOD  SetOwningNode(nsIDOMNode* aOwningNode) = 0;
  89.  
  90.   NS_IMETHOD  SetOwnerRule(nsICSSImportRule* aOwnerRule) = 0;
  91.   NS_IMETHOD  GetOwnerRule(nsICSSImportRule** aOwnerRule) = 0;
  92.   
  93.   // get namespace map for sheet
  94.   virtual NS_HIDDEN_(nsXMLNameSpaceMap*) GetNameSpaceMap() const = 0;
  95.  
  96.   NS_IMETHOD  Clone(nsICSSStyleSheet* aCloneParent,
  97.                     nsICSSImportRule* aCloneOwnerRule,
  98.                     nsIDocument* aCloneDocument,
  99.                     nsIDOMNode* aCloneOwningNode,
  100.                     nsICSSStyleSheet** aClone) const = 0;
  101.  
  102.   NS_IMETHOD  IsModified(PRBool* aModified) const = 0; // returns the mDirty status of the sheet
  103.   NS_IMETHOD  SetModified(PRBool aModified) = 0;
  104.  
  105.   NS_IMETHOD  AddRuleProcessor(nsCSSRuleProcessor* aProcessor) = 0;
  106.   NS_IMETHOD  DropRuleProcessor(nsCSSRuleProcessor* aProcessor) = 0;
  107. };
  108.  
  109. nsresult
  110. NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult);
  111.  
  112. #endif /* nsICSSStyleSheet_h___ */
  113.